// https://www.acwing.com/problem/content/842/

#include <iostream>
#include <vector>
#include <unordered_set>
using namespace std;

// STL 的解决方法（不推荐）

int main() {
    int n, tmp;
    char ch[2];
    scanf("%d", &n);
    unordered_set<int> nums;
    while (n-->0) {
        scanf("%s%d", &ch, &tmp);
        if (*ch == 'I') {
            nums.insert(tmp);
        } else if (*ch == 'Q') {
            if (nums.find(tmp) != nums.end()) {
                cout<<"Yes"<<endl;
            } else {
                cout<<"No"<<endl;
            }
        }
    }
    return 0;
}
